package cn.manyufun.myf.ui.user.presenter;

import cn.manyufun.myf.bean.UserDetail;
import cn.manyufun.myf.common.base.BasePresenter;
import cn.manyufun.myf.common.baserx.RxSubscriber;
import cn.manyufun.myf.ui.main.fragment.UserInfoFragment;
import cn.manyufun.myf.ui.user.model.UserInfoModel;

/**
 * @author Kevin Xiao
 * @date Create Date: 2018-01-16
 * @Description
 */
public class UserInfoPresenter extends BasePresenter<UserInfoFragment, UserInfoModel> {
    public void loadUserDetailRequest() {
        mRxManage.add(mModel.loadUserInfo()
                .subscribe(new RxSubscriber<UserDetail>(mContext, false) {
                    @Override
                    public void onStart() {
                        super.onStart();
                    }

                    @Override
                    protected void _onNext(UserDetail userDetail) {
                        mView.returnUserDetail(userDetail);
                    }

                    @Override
                    protected void _onError(String message) {
                    }
                }));
    }

}
